<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
		<title>XXX System</title>
		
		<link rel="stylesheet" type="text/css" href="./css/cm-default.css"  />
		<link rel="stylesheet" type="text/css" href="./ligerUI/skins/Aqua/css/ligerui-all.css" />
		<script src="./js/jquery-min.js" type="text/javascript"></script>
		<script src="./ligerUI/js/ligerui.min.js" type="text/javascript"></script>
		<script type="text/javascript">
			var tabManager = null;
			var accordion = null;
			var tree = null;
			$(function(){
			    //布局
			    $("#layout_main").ligerLayout({leftWidth:190,height:'100%',heightDiff:-5,space:4,onHeightChanged:f_heightChanged});
			    var height = $(".l-layout-center").height();
			    $("#framecenter").ligerTab({height:height});  //Tab
			    $("#accordion_left").ligerAccordion({height:height-24,speed:null});
			
			    tabManager = $("#framecenter").ligerGetTabManager();
			    accordion = $("#accordion_left").ligerGetAccordionManager();

				var tree = $("#tree1").ligerTree({
					url: "rbac/cmMenu.do?method=init",
					checkbox: false,
					topParentIDValue:1,  
					idFieldName:'id',
					slide:false,
					isExpand: false,
					parentIDFieldName:'pid',
					btnClickToToggleOnly: false,
                    onSelect: function(node) {
                        if (!node.data.url) return;
                        var tabid = $(node.target).attr("tabid");
                        if (!tabid) {
                            tabid = new Date().getTime();
                            $(node.target).attr("tabid", tabid)
                        } 
                        f_addTab(tabid, node.data.text, decodeURIComponent(node.data.url));
                    },
					onError: function() {
						alert("error");
					}
				});
	            treeManager = $("#tree1").ligerGetTreeManager();
	            treeManager.collapseAll();
		          
			    $("#pageloading").hide();
			});
			$.ajax({
				url: "rbac/cmUser.do?method=getUserInfo",
				type: "POST",
				dataType: "json",
				contentType: "application/json; charset=utf-8",
				success: function(data) {
					if (data["status"] === "1")
						$("#unameA").text(data["uname"]);
				},
				error:function(data){
					alert("error");
				}
			});
			function f_heightChanged(options) {
			    if (tabManager) tabManager.addHeight(options.diff);
			    if (accordion && options.middleHeight - 24 > 0)
			        accordion.setHeight(options.middleHeight - 24);
			}
			function f_addTab(tabid,text, url) { 
				tabManager.addTabItem({tabid:tabid, text:text, url:url});
			}
	    </script>
		<style type="text/css">
		    .l-link{text-decoration:none !important;color:white; margin-left:2px;margin-right:2px;}
		    .l-link:hover{color:#FF8040;}
		    .space{ color:#E7E7E7;}
		    .l-topmenu{ margin:0; padding:0; height:31px; line-height:31px; background:url('./images/top.jpg') repeat-x bottom;  position:relative; border-top:1px solid #1D438B;  }
		    .l-topmenu-logo{ color:#E7E7E7; padding-left:35px; line-height:26px;}
		    .l-topmenu-welcome{  position:absolute; height:24px; line-height:24px;  right:30px; top:2px;color:#070A0C;}
	    	.l-topmenu-welcome a{ color:#E7E7E7; text-decoration:underline}
		</style>
	</head>
	<body style="padding: 0;">
		<div id="pageloading"></div>  
		<div id="topmenu" class="l-topmenu">
		    <div class="l-topmenu-logo" style="font-weight: bold; font-size: 16px;">XXX系统</div>
		    <div class="l-topmenu-welcome">
		        <a href="#" class="l-link" id="unameA"></a>
		        <span class="space">|</span>
		        <a href="rbac/cmUser.do?method=logout" class="l-link">退出</a>
		    </div>
		</div>
		<div id="layout_main">
			<div position="left" title="功能列表" id="accordion_left" style="overflow:auto;">
				<ul id="tree1" style="margin-top:3px;" />
			</div>
			<div position="center" id="framecenter">
				<!--div tabid="home" title="首页" style="height:300px;border;1px;" ></div-->
			</div>
		</div>
	</body>
</html>